package io.renren.modules.pet.enums;

import lombok.Getter;

@Getter
public enum ApplicantAgeEnum {

    STATUS_0(0, "60后"),

    STATUS_1(1, "70后"),

    STATUS_2(2, "80后"),

    STATUS_3(3, "90后"),

    STATUS_4(4, "00后");

    private Integer index;

    private String chn;

    private ApplicantAgeEnum(Integer index, String chn) {
        this.index = index;
        this.chn = chn;
    }

    /**
     * 通过索引获取中文表示
     * @param index
     * @return
     */
    public static String getChnByIndex (Integer index) {
        ApplicantAgeEnum[] applicantAgeEnums = ApplicantAgeEnum.values();
        for (ApplicantAgeEnum applicantAgeEnum : applicantAgeEnums) {
            if (applicantAgeEnum.index.equals(index)) {
                return applicantAgeEnum.chn;
            }
        }
        return null;
    }

}
